package com.luke.star.enums;

import java.util.HashMap;
import java.util.Map;


public enum StTaskStateEnum {
	doing("00", "进行中"), ok("01", "已完成");
	
	public String code;
	public String desc;
	private StTaskStateEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static Map<String, String> getDataMap() {
		Map<String, String> keyValueMap = new HashMap<String, String>();
		for (StTaskStateEnum single : StTaskStateEnum.values()) {
			keyValueMap.put(single.code, single.desc);
		}
		return keyValueMap;
	}
	public static String getDesc(String code) {
		for (StTaskStateEnum single : StTaskStateEnum.values()) {
			if(single.code.equals(code)) {
				return single.desc;
			}
		}
		return code;
	}
}
